3.8.5 \(\int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx\) [705]

Optimal. Leaf size=115 \[ \frac {(i A (1-n)+B (1+n)) \, _2F_1\left (1,n;1+n;\frac {1}{2} (1-i \tan (e+f x))\right ) (c-i c \tan (e+f x))^n}{4 a f n}+\frac {(i A-B) (c-i c \tan (e+f x))^n}{2 a f (1+i \tan (e+f x))} \]

[Out]

1/4*(I*A*(1-n)+B*(1+n))*hypergeom([1, n],[1+n],1/2-1/2*I*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/a/f/n+1/2*(I*A-B)*(c
-I*c*tan(f*x+e))^n/a/f/(1+I*tan(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.13, antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 79, 70} \begin {gather*} \frac {(B (n+1)+i A (1-n)) (c-i c \tan (e+f x))^n \, _2F_1\left (1,n;n+1;\frac {1}{2} (1-i \tan (e+f x))\right )}{4 a f n}+\frac {(-B+i A) (c-i c \tan (e+f x))^n}{2 a f (1+i \tan (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n)/(a + I*a*Tan[e + f*x]),x]

[Out]

((I*A*(1 - n) + B*(1 + n))*Hypergeometric2F1[1, n, 1 + n, (1 - I*Tan[e + f*x])/2]*(c - I*c*Tan[e + f*x])^n)/(4
*a*f*n) + ((I*A - B)*(c - I*c*Tan[e + f*x])^n)/(2*a*f*(1 + I*Tan[e + f*x]))

Rule 70

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b*c - a*d)^n*((a + b*x)^(m + 1)/(b^(
n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rule 79

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || L
tQ[p, n]))))

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^{-1+n}}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) (c-i c \tan (e+f x))^n}{2 a f (1+i \tan (e+f x))}+\frac {(c (A (1-n)-i B (1+n))) \text {Subst}\left (\int \frac {(c-i c x)^{-1+n}}{a+i a x} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {(i A (1-n)+B (1+n)) \, _2F_1\left (1,n;1+n;\frac {1}{2} (1-i \tan (e+f x))\right ) (c-i c \tan (e+f x))^n}{4 a f n}+\frac {(i A-B) (c-i c \tan (e+f x))^n}{2 a f (1+i \tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 9.53, size = 111, normalized size = 0.97 \begin {gather*} \frac {2^{-1+n} \left (\frac {c}{1+e^{2 i (e+f x)}}\right )^n \left ((A+i B) (-1+n)+e^{2 i (e+f x)} (A (-1+n)+i B (1+n)) \, _2F_1\left (1,1-n;2-n;1+e^{2 i (e+f x)}\right )\right )}{a f (-1+n) (-i+\tan (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n)/(a + I*a*Tan[e + f*x]),x]

[Out]

(2^(-1 + n)*(c/(1 + E^((2*I)*(e + f*x))))^n*((A + I*B)*(-1 + n) + E^((2*I)*(e + f*x))*(A*(-1 + n) + I*B*(1 + n
))*Hypergeometric2F1[1, 1 - n, 2 - n, 1 + E^((2*I)*(e + f*x))]))/(a*f*(-1 + n)*(-I + Tan[e + f*x]))

________________________________________________________________________________________

Maple [F]
time = 1.08, size = 0, normalized size = 0.00 \[\int \frac {\left (A +B \tan \left (f x +e \right )\right ) \left (c -i c \tan \left (f x +e \right )\right )^{n}}{a +i a \tan \left (f x +e \right )}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e)),x)

[Out]

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e)),x)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

integral(1/2*((A - I*B)*e^(2*I*f*x + 2*I*e) + A + I*B)*(2*c/(e^(2*I*f*x + 2*I*e) + 1))^n*e^(-2*I*f*x - 2*I*e)/
a, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \left (\int \frac {A \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{\tan {\left (e + f x \right )} - i}\, dx + \int \frac {B \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan {\left (e + f x \right )}}{\tan {\left (e + f x \right )} - i}\, dx\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**n/(a+I*a*tan(f*x+e)),x)

[Out]

-I*(Integral(A*(-I*c*tan(e + f*x) + c)**n/(tan(e + f*x) - I), x) + Integral(B*(-I*c*tan(e + f*x) + c)**n*tan(e
 + f*x)/(tan(e + f*x) - I), x))/a

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((B*tan(f*x + e) + A)*(-I*c*tan(f*x + e) + c)^n/(I*a*tan(f*x + e) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\left (A+B\,\mathrm {tan}\left (e+f\,x\right )\right )\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^n}{a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(c - c*tan(e + f*x)*1i)^n)/(a + a*tan(e + f*x)*1i),x)

[Out]

int(((A + B*tan(e + f*x))*(c - c*tan(e + f*x)*1i)^n)/(a + a*tan(e + f*x)*1i), x)

________________________________________________________________________________________